package com.chanzany.mediator;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author ChanZany
 * @Date 2021/10/19 10:16
 * @Version 1.0
 * 抽象中介类
 */
public abstract class Mediator {
    //聚合房主和具体的租房者对象
    protected List<Person> colleagues = new ArrayList<>();

    public void register(Person person){
        if (colleagues.contains(person)) return;
        colleagues.add(person);
    }
    public abstract void contact(String message, Person person);
}
